package study03;

/**
* @author GZQ
* @Date 2023/11/5
 */

public class While1 {
    public static void main(String[] args) {
        //1+3+5+7+....+100
        int num = 1;
        int result = 0;
        while (num <= 100) {
            if (num % 2 != 0) {
                result = result + num;
            }
            num++;
        }
        System.out.println("1+3+5+7+...100的和是：" + result);
    }
}